<template>
  <div>
    <div class="i">
      <input type="text" :placeholder="title" />
      <span>搜索</span>
    </div>
    <ul>
      <li v-for="(v, i) in data" :key="v.iId">
        <span>{{ i + 1 }}</span>
        <span>{{ v.sTitle }}</span>
        <span>{{ v.iTime }}</span>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ["data", "title"],
  mounted() {
    console.log(this.data, 1);
  },
};
</script>

<style lang="scss" scoped>
.i {
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  input {
    width: 370px;
    padding: 2% 2% 2% 8%;
    outline: none;
    background-image: url("/public/img/icon-bg.png");
    background-position: 0 0;
    background-repeat: no-repeat;
    background-color: rgb(78, 78, 83);
    border: none;
    border-radius: 4px;
  }
  span {
    border: 1px solid gray;
    padding: 4px 16px;
    background-color: rgb(78, 78, 83);
    border-radius: 4px;
    color: white;
  }
}
ul {
  height: 252px;
  overflow: auto;
  padding: 16px 0;
  li {
    display: flex;
    align-items: center;
    font-size: 14px;
    margin-bottom: 4px;
    > span:first-child {
      border: 1px solid rgb(243, 194, 88);
      //   padding: 0 4px;
      border-radius: 2px;
      color: gray;
      width: 16px;
      line-height: 14px;
      text-align: center;
      font-size: 12px;
    }
    > span:nth-child(2) {
      //   border: 1px solid red;
      cursor: pointer;
      display: inline-block;
      white-space: nowrap;
      text-overflow: ellipsis;
      width: 352px;
      overflow: hidden;
      //   border: 1px solid red;
      color: rgb(184, 185, 197);
      padding-left: 12px;
      &:hover {
        text-decoration: underline;
      }
    }
    > span:last-child {
      display: inline-block;
      width: 60px;
      color: gray;
      // border: 1px solid red;
      text-align: right;
    }
    &:not(:nth-child(1), :nth-child(2), :nth-child(3)) {
      > span:first-child {
        border-color: gray;
      }
    }
  }
}
ul::-webkit-scrollbar {
  /*滚动条整体样式*/
  width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
  height: 1px;
}
ul::-webkit-scrollbar-thumb {
  /*滚动条里面小方块*/
  cursor: pointer !important;
  border-radius: 10px;
  box-shadow: inset 0 0 5px rgb(0, 0, 0, 0.2);
  background: rgb(38, 43, 40);
}
ul::-webkit-scrollbar-track {
  /*滚动条里面轨道*/
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  background: rgb(54, 54, 61);
  cursor: pointer !important;
}
</style>